package wahadlo.controllers;

/**
 * Implementacja walidatora.
 * 
 * @author Koziołek
 * 
 */
/**
 * @author Koziołek
 * 
 */
public class DataValidatorImpl implements DataValidator {

	/*
	 * (non-Javadoc)
	 * 
	 * @see wahadlo.controllers.DataValidator#absoluteGreatThanZero(java.lang.Double)
	 */
	public boolean absoluteGreatThanZero(Double value) {
		if (value == null)
			return false;
		return Math.abs(value) > 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see wahadlo.controllers.DataValidator#greatEqualsThanZero(java.lang.Double)
	 */
	public boolean greatEqualsThanZero(Double value) {
		if (value == null)
			return false;
		return value >= 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see wahadlo.controllers.DataValidator#greatThanZero(java.lang.Double)
	 */
	public boolean greatThanZero(Double value) {
		if (value == null)
			return false;
		return value > 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see wahadlo.controllers.DataValidator#lessEqualsThanZero(java.lang.Double)
	 */
	public boolean lessEqualsThanZero(Double value) {
		if (value == null)
			return false;
		return value <= 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see wahadlo.controllers.DataValidator#lessThanZero(java.lang.Double)
	 */
	public boolean lessThanZero(Double value) {
		if (value == null)
			return false;
		return value < 0;
	}

}
